const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const isDev = process.env.NODE_ENV === 'development';
const config = {
    mode:"development",
    entry:path.join(__dirname,'./src/index.js'),
    output:{
        path:path.join(__dirname,'./dist'),
        filename:'main.js'
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:path.join(__dirname,'./src/index.html')
        })
    ],
    resolve:{
        extensions:['.js','.ts']
    },
    module:{
        rules:[
            {
                test:/\.js$/,
                use: 'babel-loader',
                exclude:[
                    path.join(__dirname,'./node_modules')
                ]
            },
            {
                test:/\.ts$/,
                use: 'ts-loader',
                exclude:[
                    path.join(__dirname,'./node_modules')
                ]
            }
        ]
    },
};
 
module.exports = config